﻿using AppService.IService.Financial_Management;
using Domain.Entity.Basic_information;
using Domain.Entity.Financial_Management;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Domain.IRepository.Financial_Management;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.Financial_Management
{
    [Dependency(ServiceLifetime.Scoped)]
    public class Payable_meterService : IPayable_meterService
    {
        private readonly IPayable_meterRepository pm_Repository;

        public Payable_meterService(IPayable_meterRepository PmRepository)
        {
            this.pm_Repository = PmRepository;
        }
        public int Count(string? Billing_status, string? Origin_place, string? Det_place, string? Sign_time)
        {
            return pm_Repository.Count(Billing_status,Origin_place,Det_place,Sign_time);
        }

        public Carrier_ment GetCarrier_id(int id)
        {
            return pm_Repository.GetCarrier_id(id);
        }

        public Drivers_ment GetDrivers_id(int id)
        {
            return pm_Repository.GetDrivers_id(id);
        }

        public Wb_meter GetWb_id(int id)
        {
            return pm_Repository.GetWb_id(id);
        }

        public List<Payable_meter> GetPayable_meter(int currentPage,int PageSize)
        {
            return pm_Repository.GetPayable_meter().Skip((currentPage - 1) * PageSize).Take(PageSize).ToList();
        }

        public Signature_receipt GetSign_id(int id)
        {
            return pm_Repository.GetSign_id(id);
        }

        public List<Payable_meter> GetPayable_meter_Update(int Payable_id)
        {
            return pm_Repository.GetPayable_meter_Update(Payable_id);
        }

        public bool Update(Payable_meter payable_meter)
        {
            return pm_Repository.Update(payable_meter)>0;
        }
    }
}
